home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / u_man / cat1 / make.z / make
Encoding:
Text File  |  2002-10-03  |  66.1 KB  |  1,387 lines

  1.  
  2.  
  3.  
  4. MMMMAAAAKKKKEEEE((((1111))))                                                                MMMMAAAAKKKKEEEE((((1111))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _mmmm_aaaa_kkkk_eeee - maintain, update, and regenerate groups of programs (_DDDD_EEEE_VVVV_EEEE_LLLL_OOOO_PPPP_MMMM_EEEE_NNNN_TTTT)
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _mmmm_aaaa_kkkk_eeee _[[[[_----_eeee_iiii_kkkk_nnnn_pppp_qqqq_rrrr_ssss_SSSS_tttt_uuuu_wwww_dddd_DDDD_PPPP_BBBB_NNNN_MMMM_OOOO_gggg_]]]] _[[[[_----_ffff _m_a_k_e_f_i_l_e_]]]] _...._...._....       _[[[[_m_a_c_r_o_s=_n_a_m_e_]]]] _...._...._....
  13.      [_t_a_r_g_e_t__n_a_m_e_]]]] _...._...._....
  14.  
  15. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  16.      The _m_a_k_e utility can be used as a part of software development to update
  17.      files that are derived from other files. A typical case is one where
  18.      object files are derived from the corresponding source files. The _m_a_k_e
  19.      utility examines time relationships and updates those derived files
  20.      (called targets) that have modified times earlier than the modified times
  21.      of the files (called prerequisites) from which they are derived.  A
  22.      description file (makefile) contains a description of the relationships
  23.      between files, and the commands that must be executed to update the
  24.      targets to reflect changes in their prerequisites. Each specification, or
  25.      rule, consists of a target, optional prerequisites and optional commands
  26.      to be executed when a prerequisite is newer than the target. There are
  27.      two types of rule:
  28.  
  29.      -    inference rules, which have one target name with at least one period
  30.           (.) and no slash (/)
  31.  
  32.      -    target rules, which can have more than one target name.
  33.  
  34.      In addition, _m_a_k_e has a collection of built-in macros and inference rules
  35.      that infer prerequisite relationships to simplify maintenance of
  36.      programs.
  37.  
  38.      To receive exactly the behaviour described in this section, a portable
  39.      makefile must:
  40.  
  41.      -    include the special target .POSIX
  42.  
  43.      -    omit any special target reserved for implementations (a leading
  44.           period followed by upper-case letters) that has not been specified
  45.           by this section.
  46.      _NNNN_OOOO_TTTT_EEEE_:::: See _CCCC_OOOO_MMMM_PPPP_AAAA_TTTT_IIII_BBBB_IIII_LLLL_IIII_TTTT_YYYY _IIII_SSSS_SSSS_UUUU_EEEE_SSSS section below for when these conditions
  47.      are not met.
  48.  
  49. OOOOPPPPTTTTIIIIOOOONNNNSSSS
  50.      The following options are supported:
  51.  
  52.      ----bbbb           Compatibility mode for old makefiles.
  53.  
  54.      ----BBBB           Blocked output.  In parallel mode, the output from
  55.                   concurrently updating targets can be either intermingled or
  56.                   saved up and printed upon completion of the target.  The
  57.                   default is to intermingle the output, this option turns on
  58.                   the 'blocking' of output until the target has completed.
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. MMMMAAAAKKKKEEEE((((1111))))                                                                MMMMAAAAKKKKEEEE((((1111))))
  71.  
  72.  
  73.  
  74.      ----dddd           Debug.  As targets are traversed, the reason they are being
  75.                   updated is printed.
  76.  
  77.      ----DDDD           Debug.  A full dump of all aspects of target and variable
  78.                   handling.  This option usually produces an overwhelming
  79.                   amount of information.
  80.  
  81.      ----eeee           Cause environment variables, including those with null
  82.                   values, to override macro assignments within makefiles.
  83.  
  84.      ----ffff _m_a_k_e_f_i_l_e  Specify a different makefile. The argument makefile is a
  85.                   pathname of a description file, which is also referred to as
  86.                   the makefile. A pathname of - denotes the standard input.
  87.                   There can be multiple instances of this option, and they
  88.                   will be processed in the order specified.
  89.  
  90.      ----gggg           Auto get.  If a file does not exist, attempt to 'get' it
  91.                   from SCCS using the $$$$((((GGGGEEEETTTT)))) macro.
  92.  
  93.      ----iiii           Ignore error codes returned by invoked commands. This mode
  94.                   is the same as if the special target _...._IIII_GGGG_NNNN_OOOO_RRRR_EEEE were specified
  95.                   without prerequisites.
  96.  
  97.      ----kkkk           Continue to update other targets that do not depend on the
  98.                   current target if a non-ignored error occurs while executing
  99.                   the commands to bring a target up-to-date.
  100.  
  101.      ----MMMM           Turn off ----NNNN (this is the default).
  102.  
  103.      ----nnnn           Write commands that would be executed on standard output,
  104.                   but do not execute them. However, lines with a plus sign (_++++)
  105.                   prefix will be executed. In this mode, lines with an at sign
  106.                   (_@@@@) character prefix will be written to standard output.
  107.  
  108.      ----NNNN           Permit targets that have dependencies to still be candidates
  109.                   for application of the _e_m_p_t_y _r_u_l_e (_N_U_L_L) suffix
  110.                   transformation rules _((((_ssss_eeee_eeee _tttt_hhhh_eeee _""""_IIII_nnnn_ffff_eeee_rrrr_eeee_nnnn_cccc_eeee _RRRR_uuuu_llll_eeee_ssss_"""" _ssss_eeee_cccc_tttt_iiii_oooo_nnnn
  111.                   _bbbb_eeee_llll_oooo_wwww_))))_....
  112.  
  113.      ----OOOO           Turn off compatibility mode for old makefiles.
  114.  
  115.      ----pppp           Write to standard output the complete set of macro
  116.                   definitions and target descriptions. The output format is
  117.                   unspecified.
  118.  
  119.      ----PPPP           Parallel.  Enables building independent parts of the
  120.                   makefile concurrently _((((_ssss_eeee_eeee _""""_PPPP_aaaa_rrrr_aaaa_llll_llll_eeee_llll _EEEE_xxxx_eeee_cccc_uuuu_tttt_iiii_oooo_nnnn_"""" _ssss_eeee_cccc_tttt_iiii_oooo_nnnn
  121.                   _bbbb_eeee_llll_oooo_wwww_))))_....
  122.  
  123.      ----qqqq           Return a zero exit value if the target file is up-to-date;
  124.                   otherwise, return an exit value of 1 (one). Targets will not
  125.                   be updated if this option is specified. However, a command
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. MMMMAAAAKKKKEEEE((((1111))))                                                                MMMMAAAAKKKKEEEE((((1111))))
  137.  
  138.  
  139.  
  140.                   line (associated with the targets) with a plus sign (_++++)
  141.                   prefix will be executed.
  142.  
  143.      ----rrrr           Clear the suffix list and do not use the built-in rules.
  144.  
  145.      ----ssss           Do not write command lines or touch messages (see _----_tttt) to
  146.                   standard output before executing. This mode is the same as
  147.                   if the special target _...._SSSS_IIII_LLLL_EEEE_NNNN_TTTT were specified without
  148.                   prerequisites.
  149.  
  150.      ----SSSS           Terminate _m_a_k_e if an error occurs while executing the
  151.                   commands to bring a target up-to-date. This will be the
  152.                   default and the opposite of the _----_kkkk option.
  153.  
  154.      ----tttt           Update the modification time of each target as though a
  155.                   _t_o_u_c_h _t_a_r_g_e_t had been executed. Targets that have
  156.                   prerequisites but no commands (see _TTTT_aaaa_rrrr_gggg_eeee_tttt _RRRR_uuuu_llll_eeee_ssss), or that
  157.                   are already up-to-date, will not be touched in this manner.
  158.                   Write messages to standard output for each target file
  159.                   indicating the name of the file and that it was touched.
  160.                   Normally, the command lines associated with each target are
  161.                   not executed. However, a command line with a plus sign (_++++)
  162.                   prefix will be executed.
  163.  
  164.      ----uuuu           Unconditional.  Build all targets regardless of whether they
  165.                   are up-to-date or not.
  166.  
  167.      ----wwww           Suppress warning messages.  Fatal messages will not be
  168.                   affected.
  169.  
  170.      If the _----_kkkk and _----_SSSS options are both specified on the command line, by the
  171.      _M_A_K_E_F_L_A_G_S environment variable, or by the _MMMM_AAAA_KKKK_EEEE_FFFF_LLLL_AAAA_GGGG_SSSS macro, the last one
  172.      evaluated will take precedence. The _M_A_K_E_F_L_A_G_S environment variable will
  173.      be evaluated first and the command line will be evaluated second.
  174.      Assignments to the _MMMM_AAAA_KKKK_EEEE_FFFF_LLLL_AAAA_GGGG_SSSS macro will be evaluated as described in the
  175.      _""""_EEEE_NNNN_VVVV_IIII_RRRR_OOOO_NNNN_MMMM_EEEE_NNNN_TTTT _VVVV_AAAA_RRRR_IIII_AAAA_BBBB_LLLL_EEEE_SSSS_"""" section.
  176.  
  177.  
  178. OOOOPPPPEEEERRRRAAAANNNNDDDDSSSS
  179.      The following operands are supported:
  180.  
  181.      _t_a_r_g_e_t__n_a_m_e
  182.           Target names, as defined in _EEEE_XXXX_TTTT_EEEE_NNNN_DDDD_EEEE_DDDD _DDDD_EEEE_SSSS_CCCC_RRRR_IIII_PPPP_TTTT_IIII_OOOO_NNNN_....  If no target is
  183.           specified, while _m_a_k_e is processing the makefiles, the first target
  184.           that _m_a_k_e encounters that is not a special target or an inference
  185.           rule will be used.
  186.  
  187.      _m_a_c_r_o=_n_a_m_e
  188.           Macro definitions, as defined in the _MMMM_aaaa_cccc_rrrr_oooo_ssss section.
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. MMMMAAAAKKKKEEEE((((1111))))                                                                MMMMAAAAKKKKEEEE((((1111))))
  203.  
  204.  
  205.  
  206. SSSSTTTTDDDDIIIINNNN
  207.      The standard input will be used only if the makefile option-argument is
  208.      ----.... See _IIII_NNNN_PPPP_UUUU_TTTT _FFFF_IIII_LLLL_EEEE_SSSS section.
  209.  
  210. IIIINNNNPPPPUUUUTTTT FFFFIIIILLLLEEEESSSS
  211.      The input file, otherwise known as the makefile, is a text file
  212.      containing rules, macro definitions and comments.
  213.  
  214. EEEENNNNVVVVIIIIRRRROOOONNNNMMMMEEEENNNNTTTT VVVVAAAARRRRIIIIAAAABBBBLLLLEEEESSSS
  215.      The following environment variables affect the execution of _m_a_k_e:
  216.  
  217.      _M_A_K_E_F_L_A_G_S
  218.           This variable is interpreted as a character string representing a
  219.           series of option characters to be used as the default options. The
  220.           implementation will accept both of the following formats (but need
  221.           not accept them when intermixed):
  222.  
  223.           1.  The characters are option letters without the leading hyphens or
  224.               blank character separation used on a command line.
  225.  
  226.           2.  The characters are formatted in a manner similar to a portion of
  227.               the _m_a_k_e command line: options are preceded by hyphens and
  228.               blank-character-separated. The _m_a_c_r_o=_n_a_m_e macro definition
  229.               operands can also be included. The difference between the
  230.               contents of _MMMM_AAAA_KKKK_EEEE_FFFF_LLLL_AAAA_GGGG_SSSS and the command line is that the contents
  231.               of the variable will not be subjected to the word expansions.
  232.  
  233.           When the command-line options _----f or _----p are used, they will take
  234.           effect regardless of whether they also appear in _MMMM_AAAA_KKKK_EEEE_FFFF_LLLL_AAAA_GGGG_SSSS_....
  235.  
  236.           The _MMMM_AAAA_KKKK_EEEE_FFFF_LLLL_AAAA_GGGG_SSSS variable will be accessed from the environment before
  237.           the makefile is read. At that time, all of the options (except _----f
  238.           and _----p ) and command-line macros not already included in _MMMM_AAAA_KKKK_EEEE_FFFF_LLLL_AAAA_GGGG_SSSS
  239.           are added to the _MMMM_AAAA_KKKK_EEEE_FFFF_LLLL_AAAA_GGGG_SSSS macro. The _MMMM_AAAA_KKKK_EEEE_FFFF_LLLL_AAAA_GGGG_SSSS macro will be passed
  240.           into the environment as an environment variable for all child
  241.           processes. If the _MMMM_AAAA_KKKK_EEEE_FFFF_LLLL_AAAA_GGGG_SSSS macro is subsequently set by the
  242.           makefile, it replaces the _M_A_K_E_F_L_A_G_S variable currently found in the
  243.           environment.
  244.  
  245.      The value of the _S_H_E_L_L environment variable will not be used as a macro
  246.      and will not be modified by defining the _SSSS_HHHH_EEEE_LLLL_LLLL macro in a makefile or on
  247.      the command line. All other environment variables, including those with
  248.      null values, are used as macros, as defined in the _""""_MMMM_aaaa_cccc_rrrr_oooo_ssss_"""" section.
  249.  
  250.  
  251. AAAASSSSYYYYNNNNCCCCHHHHRRRROOOONNNNOOOOUUUUSSSS EEEEVVVVEEEENNNNTTTTSSSS
  252.      If not already ignored, _m_a_k_e will trap SIGHUP, SIGTERM, SIGINT and
  253.      SIGQUIT and remove the current target unless the target is a directory or
  254.      the target is a prerequisite of the special target _...._PPPP_RRRR_EEEE_CCCC_IIII_OOOO_UUUU_SSSS or unless
  255.      one of the _----_nnnn, _----_pppp or _----_qqqq options was specified. Any targets removed in
  256.      this manner will be reported in diagnostic messages of unspecified
  257.      format, written to standard error. After this cleanup process, if any,
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. MMMMAAAAKKKKEEEE((((1111))))                                                                MMMMAAAAKKKKEEEE((((1111))))
  269.  
  270.  
  271.  
  272.      _m_a_k_e will take the standard action for all other signals.
  273.  
  274.  
  275. SSSSTTTTDDDDOOOOUUUUTTTT
  276.      The _m_a_k_e utility will write all commands to be executed to standard
  277.      output unless the s option was specified, the command is prefixed with an
  278.      at sign, or the special target _...._SSSS_IIII_LLLL_EEEE_NNNN_TTTT has either the current target as a
  279.      prerequisite or has no prerequisites. If _m_a_k_e is invoked without any work
  280.      needing to be done, it will write a message to standard output indicating
  281.      that no action was taken.
  282.  
  283. SSSSTTTTDDDDEEEERRRRRRRR
  284.      Used only for diagnostic messages.
  285.  
  286. OOOOUUUUTTTTPPPPUUUUTTTT FFFFIIIILLLLEEEESSSS
  287.      None. However, utilities invoked by _m_a_k_e may create additional files.
  288.  
  289. EEEEXXXXTTTTEEEENNNNDDDDEEEEDDDD DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  290.      The _m_a_k_e utility attempts to perform the actions required to ensure that
  291.      the specified targets are up-to-date. A target is considered out-of-date
  292.      if it is older than any of its prerequisites or if it does not exist. The
  293.      _m_a_k_e utility treats all prerequisites as targets themselves and
  294.      recursively ensures that they are up-to-date, processing them in the
  295.      order in which they appear in the rule. The _m_a_k_e utility uses the
  296.      modification times of files to determine if the corresponding targets are
  297.      out-of-date.
  298.  
  299.      After _m_a_k_e has ensured that all of the prerequisites of a target are up-
  300.      to-date and if the target is out-of-date, the commands associated with
  301.      the target entry are executed. If there are no commands listed for the
  302.      target, the target is treated as up-to-date.
  303.  
  304.      MMMMaaaakkkkeeeeffffiiiilllleeee SSSSyyyynnnnttttaaaaxxxx
  305.  
  306.      A makefile can contain rules, macro definitions, and comments. There are
  307.      two kinds of rules: inference rules and target rules. The _m_a_k_e utility
  308.      contains a set of built-in inference rules. If the _----r option is present,
  309.      the built-in rules are not used and the suffix list is cleared.
  310.      Additional rules of both types can be specified in a makefile. If a rule
  311.      or macro is defined more than once, the value of the rule or macro will
  312.      be that of the last one specified. Comments start with a number sign (_####)
  313.      and continue until an unescaped newline character is reached.
  314.  
  315.      By default, the following files are tried in sequence:  ....////mmmmaaaakkkkeeeeffffiiiilllleeee,,,,
  316.      ....////MMMMaaaakkkkeeeeffffiiiilllleeee,,,, ....////ssss....mmmmaaaakkkkeeeeffffiiiilllleeee,,,, SSSSCCCCCCCCSSSS////ssss....mmmmaaaakkkkeeeeffffiiiilllleeee,,,, ....////ssss....MMMMaaaakkkkeeeeffffiiiilllleeee and
  317.      _SSSS_CCCC_CCCC_SSSS_////_ssss_...._MMMM_aaaa_kkkk_eeee_ffff_iiii_llll_eeee_....
  318.  
  319.      The _----f option directs _m_a_k_e to ignore any of these default files and use
  320.      the specified argument as a makefile instead. If the _---- argument is
  321.      specified, standard input will be used.
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. MMMMAAAAKKKKEEEE((((1111))))                                                                MMMMAAAAKKKKEEEE((((1111))))
  335.  
  336.  
  337.  
  338.      The term makefile is used to refer to any rules provided by the user,
  339.      whether in
  340.  
  341.      The rules in makefiles consist of the following types of lines: target
  342.      rules, including special targets (see _TTTT_aaaa_rrrr_gggg_eeee_tttt _RRRR_uuuu_llll_eeee_ssss);  inference rules
  343.      (see _IIII_nnnn_ffff_eeee_rrrr_eeee_nnnn_cccc_eeee _RRRR_uuuu_llll_eeee_ssss); macro definitions (see _MMMM_aaaa_cccc_rrrr_oooo_ssss); empty lines; and
  344.      comments.  Comments start with a number sign (_####) and continue until an
  345.      unescaped newline character is reached.
  346.  
  347.      When an escaped newline character (one preceded by a _bbbb_aaaa_cccc_kkkk_ssss_llll_aaaa_ssss_hhhh) is found
  348.      anywhere in the makefile, it is replaced, along with any leading white
  349.      space on the following line, with a single space character.
  350.  
  351.      MMMMaaaakkkkeeeeffffiiiilllleeee EEEExxxxeeeeccccuuuuttttiiiioooonnnn
  352.  
  353.      Command lines are processed one at a time by writing the command line to
  354.      the standard output (unless one of the conditions listed below under _@@@@
  355.      suppresses the writing) and executing the commands in the line. A tab
  356.      character may precede the command to standard output. Commands will be
  357.      executed by passing the command line to the command interpreter in the
  358.      same manner as if the string were the argument to the _s_y_s_t_e_m() function.
  359.  
  360.      The environment for the command being executed will contain all of the
  361.      variables in the environment of _m_a_k_e. The macros from the command line to
  362.      _m_a_k_e will be added to _m_a_k_e'_s environment. Other implementation-dependent
  363.      variables may also be added to _m_a_k_e'_s environment. If any command-line
  364.      macro has been defined elsewhere, the command-line value will overwrite
  365.      the existing value. If the _M_A_K_E_F_L_A_G_S variable is not set in the
  366.      environment in which _m_a_k_e was invoked, in the makefile or on the command
  367.      line, it will be created by _m_a_k_e, and will contain all options specified
  368.      on the command line except for the _----_ffff and _----_pppp options. It may also contain
  369.      implementation-dependent options.
  370.  
  371.      By default, when _m_a_k_e receives a non-zero status from the execution of a
  372.      command, it terminates with an error message to standard error.
  373.  
  374.      Command lines can have one or more of the following prefixes: a hyphen
  375.      (_----), an at sign (_@@@@), or a plus sign (_++++). These modify the way in which
  376.      _m_a_k_e processes the command. When a command is written to standard output,
  377.      the prefix is not included in the output.
  378.  
  379.      ----   If the command prefix contains a hyphen, or the _----_iiii option is present,
  380.          or the special target _...._IIII_GGGG_NNNN_OOOO_RRRR_EEEE has either the current target as a
  381.          prerequisite or has no prerequisites, any error found while executing
  382.          the command will be ignored.
  383.  
  384.      @@@@   If the command prefix contains an at sign and the command-line n
  385.          option is not specified, or the s option is present, or the special
  386.          target _...._SSSS_IIII_LLLL_EEEE_NNNN_TTTT has either the current target as a prerequisite or has
  387.          no prerequisites, the command will not be written to standard output
  388.          before it is executed.
  389.  
  390.  
  391.  
  392.  
  393.                                                                         PPPPaaaaggggeeee 6666
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. MMMMAAAAKKKKEEEE((((1111))))                                                                MMMMAAAAKKKKEEEE((((1111))))
  401.  
  402.  
  403.  
  404.      ++++   If the command prefix contains a plus sign, this indicates a command
  405.          line that will be executed even if _----_nnnn, _----_qqqq or _----_tttt is specified.
  406.  
  407.      IIIInnnncccclllluuuuddddeeee FFFFiiiilllleeeessss
  408.  
  409.      If the string _i_n_c_l_u_d_e or _s_i_n_c_l_u_d_e appears at the beginning of a line in a
  410.      _m_a_k_e_f_i_l_e, and is followed by a blank or a tab, the rest of the line is
  411.      assumed to be a filename and will be read by the current invocation,
  412.      after substituting for any macros.  For _i_n_c_l_u_d_e it is a fatal error if
  413.      the file is not readable, for _s_i_n_c_l_u_d_e a non-readable file is silently
  414.      ignored.
  415.  
  416.      AAAAlllltttteeeerrrrnnnnaaaatttteeee MMMMaaaakkkkeeee
  417.  
  418.      _m_a_k_e understands a convention similar to the alternate interpreter
  419.      feature of _e_x_e_c(_2) . If the first line of the makefile starts with a
  420.      ####!!!!aaaalllltttteeeerrrrnnnnaaaatttteeee____mmmmaaaakkkkeeee ,,,, then _m_a_k_e will attempt to _e_x_e_c the alternate make with
  421.      the same environment and arguments that _m_a_k_e itself was invoked with.
  422.      Additional arguments may be supplied on the ####!!!! line - these are placed
  423.      ahead of all the command line arguments given to the original invocation
  424.      of _m_a_k_e . If a new makefile specification is given using the ----ffff flag, any
  425.      original ----ffff options given on the command line are ignored.  If the
  426.      alternate make cannot be found in the user's PPPPAAAATTTTHHHH or make finds that it
  427.      would be re-invoking itself, then make silently ignores the line and
  428.      continues to execute the remainder of the makefile.  The ----dddd flag will
  429.      display information as to whether the alternate make was successfully
  430.      invoked.  As a special case to support compatibility with a makefile used
  431.      as a shell script (with a "#!/bin/make -f"), a lone ----ffff flag is ignored.
  432.  
  433.      PPPPaaaarrrraaaalllllllleeeellll EEEExxxxeeeeccccuuuuttttiiiioooonnnn
  434.  
  435.      The ----PPPP option turns on parallel execution. In this mode _m_a_k_e views all
  436.      dependencies for a given target as independent, and works on a set of
  437.      them concurrently.  By default, the concurrency factor is two.  This may
  438.      be changed by setting the environment variable _P_A_R_A_L_L_E_L. Note that some
  439.      makefiles make use of the property that in the non-parallel versions of
  440.      make dependencies were brought up to date in the order listed.  The
  441.      following makefile relies on this ordering and thus would not work
  442.      correctly when invoked with the parallel option:
  443.  
  444.          default: a b
  445.               a:
  446.                      mkdir foo
  447.               b:
  448.                      cd foo; echo hi
  449.  
  450.      TTTTaaaarrrrggggeeeetttt RRRRuuuulllleeeessss
  451.  
  452.      Target rules are formatted as follows:
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.                                                                         PPPPaaaaggggeeee 7777
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466. MMMMAAAAKKKKEEEE((((1111))))                                                                MMMMAAAAKKKKEEEE((((1111))))
  467.  
  468.  
  469.  
  470.           _t_a_r_g_e_t [_t_a_r_g_e_t...]: [_p_r_e_r_e_q_u_i_s_i_t_e...][; _c_o_m_m_a_n_d ]
  471.           [<_t_a_b> _c_o_m_m_a_n_d
  472.           <_t_a_b> _c_o_m_m_a_n_d
  473.           ...]
  474.           _l_i_n_e _t_h_a_t _d_o_e_s _n_o_t _b_e_g_i_n _w_i_t_h <_t_a_b>
  475.  
  476.      Target entries are specified by a blank-character-separated, non-null
  477.      list of targets, then a colon, then a blank-character-separated, possibly
  478.      empty list of prerequisites. Text following a semicolon, if any, and all
  479.      following lines that begin with a tab character, are command lines to be
  480.      executed to update the target.  The first non-empty line that does not
  481.      begin with a tab character or _#### begins a new entry. An empty or blank
  482.      line, or a line beginning with _####_,,,, may begin a new entry.
  483.  
  484.      Applications must select target names from the set of characters
  485.      consisting solely of periods, underscores, digits and alphabetics from
  486.      the portable character set. Implementations may allow other characters in
  487.      target names as extensions. The interpretation of targets containing the
  488.      characters (_%%%%) and (_"""") is implementation-dependent.  A target that has
  489.      prerequisites, but does not have any commands, can be used to add to the
  490.      prerequisite list for that target. Only one target rule for any given
  491.      target can contain commands.
  492.  
  493.      Lines that begin with one of the following are called special targets and
  494.      control the operation of _m_a_k_e:
  495.  
  496.      ....DDDDEEEEFFFFAAAAUUUULLLLTTTT     If the makefile uses this special target, it must be
  497.                   specified with commands, but without prerequisites. The
  498.                   commands will be used by _m_a_k_e if there are no other rules
  499.                   available to build a target.
  500.  
  501.      ....IIIIGGGGNNNNOOOORRRREEEE      Prerequisites of this special target are targets themselves;
  502.                   this will cause errors from commands associated with them to
  503.                   be ignored in the same manner as specified by the _----_iiii option.
  504.                   Subsequent occurrences of ....IIIIGGGGNNNNOOOORRRREEEE add to the list of targets
  505.                   ignoring command errors. If no prerequisites are specified,
  506.                   _m_a_k_e will behave as if the _----_iiii option had been specified and
  507.                   errors from all commands associated with all targets will be
  508.                   ignored.
  509.  
  510.      ....MMMMAAAAKKKKEEEEOOOOPPPPTTTTSSSS    Any command line option except ----[[[[rrrreeeeffff]]]] may be set in a
  511.                   makefile by listing it as a dependency to this target.  Note
  512.                   that this is a target not a macro; do not assign (using an
  513.                   '=') a value to it.
  514.  
  515.      ....PPPPOOOOSSSSIIIIXXXX       This special target must be specified without prerequisites
  516.                   or commands. If it appears before the first non-comment line
  517.                   in the makefile, _m_a_k_e will process the makefile as specified
  518.                   by this section; otherwise, the behaviour of _m_a_k_e is
  519.                   unspecified.
  520.  
  521.  
  522.  
  523.  
  524.  
  525.                                                                         PPPPaaaaggggeeee 8888
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532. MMMMAAAAKKKKEEEE((((1111))))                                                                MMMMAAAAKKKKEEEE((((1111))))
  533.  
  534.  
  535.  
  536.      ....PPPPRRRREEEECCCCIIIIOOOOUUUUSSSS    Prerequisites of this special target will not be removed if
  537.                   _m_a_k_e receives one of the asynchronous events explicitly
  538.                   described in AAAASSSSYYYYNNNNCCCCHHHHRRRROOOONNNNOOOOUUUUSSSS EEEEVVVVEEEENNNNTTTTSSSS.... Subsequent occurrences of
  539.                   ....PPPPRRRREEEECCCCIIIIOOOOUUUUSSSS add to the list of precious files. If no
  540.                   prerequisites are specified, all targets in the makefile
  541.                   will be treated as if specified with ....PPPPRRRREEEECCCCIIIIOOOOUUUUSSSS....
  542.  
  543.      ....SSSSCCCCCCCCSSSS____GGGGEEEETTTT    This special target must be specified without prerequisites.
  544.                   If this special target is included in a makefile, the
  545.                   commands specified with this target replace the default
  546.                   commands associated with this special target. (See "_DDDD_eeee_ffff_aaaa_uuuu_llll_tttt
  547.                   _RRRR_uuuu_llll_eeee_ssss_"""").  The commands specified with this target are used
  548.                   to get all SCCS files that are not found in the current
  549.                   directory.
  550.  
  551.                   When source files are named in a dependency list, _m_a_k_e
  552.                   treats them just like any other target. Because the source
  553.                   file is presumed to be present in the directory, there is no
  554.                   need to add an entry for it to the makefile. When a target
  555.                   has no dependencies, but is present in the directory, _m_a_k_e
  556.                   assumes that that file is up-to-date. If, however, an SCCS
  557.                   file named _SSSS_CCCC_CCCC_SSSS_////_ssss.source_file is found for a target
  558.                   _s_o_u_r_c_e__f_i_l_e, _m_a_k_e does some additional checking to assure
  559.                   that the target is up-to-date. If the target is missing, or
  560.                   if the SCCS file is newer, _m_a_k_e automatically issues the
  561.                   commands specified for the ....SSSSCCCCCCCCSSSS____GGGGEEEETTTT special target to
  562.                   retrieve the most recent version. However, if the target is
  563.                   writable by anyone, _m_a_k_e does not retrieve a new version.
  564.  
  565.      ....SSSSIIIILLLLEEEENNNNTTTT      Prerequisites of this special target are targets themselves;
  566.                   this causes commands associated with them to not be written
  567.                   to the standard output before they are executed. Subsequent
  568.                   occurrences of ....SSSSIIIILLLLEEEENNNNTTTT add to the list of targets with
  569.                   silent commands. If no prerequisites are specified, _m_a_k_e
  570.                   will behave as if the _----_ssss option had been specified and no
  571.                   commands or touch messages associated with any target will
  572.                   be written to standard output.
  573.  
  574.      ....SSSSUUUUFFFFFFFFIIIIXXXXEEEESSSS    Prerequisites of ....SSSSUUUUFFFFFFFFIIIIXXXXEEEESSSS are appended to the list of known
  575.                   suffixes and are used in conjunction with the inference
  576.                   rules (see "_IIII_nnnn_ffff_eeee_rrrr_eeee_nnnn_cccc_eeee _RRRR_uuuu_llll_eeee_ssss" ). If ....SSSSUUUUFFFFFFFFIIIIXXXXEEEESSSS does not have
  577.                   any prerequisites, the list of known suffixes will be
  578.                   cleared. Makefiles must not associate commands with
  579.                   ....SSSSUUUUFFFFFFFFIIIIXXXXEEEESSSS....
  580.  
  581.                   Targets with names consisting of a leading period followed
  582.                   by the upper-case letters POSIX and then any other
  583.                   characters are reserved for future standardisation. Targets
  584.                   with names consisting of a leading period followed by one or
  585.                   more upper-case letters are reserved for implementation
  586.                   extensions.
  587.  
  588.  
  589.  
  590.  
  591.                                                                         PPPPaaaaggggeeee 9999
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598. MMMMAAAAKKKKEEEE((((1111))))                                                                MMMMAAAAKKKKEEEE((((1111))))
  599.  
  600.  
  601.  
  602.      MMMMaaaaccccrrrroooossss
  603.  
  604.      Macro definitions are in the form:
  605.  
  606.           _s_t_r_i_n_g_1 = [ _s_t_r_i_n_g_2 ]
  607.  
  608.      The macro named _s_t_r_i_n_g_1 is defined as having the value of _s_t_r_i_n_g_2, where
  609.      _s_t_r_i_n_g_2 is defined as all characters, if any, after the equal sign, up to
  610.      a comment character (_####) or an unescaped newline character. Any blank
  611.      characters immediately before or after the equal sign will be ignored.
  612.  
  613.      Subsequent appearances of $(_s_t_r_i_n_g_1) or ${_s_t_r_i_n_g_1} _a_r_e _r_e_p_l_a_c_e_d _b_y
  614.      _s_t_r_i_n_g_2. The parentheses or braces are optional if _s_t_r_i_n_g_1 is a single
  615.      character. The macro _$$$$_$$$$ is replaced by the single character _$$$$ in effect
  616.      escaping the _$$$$ character.
  617.  
  618.      See _NNNN_OOOO_TTTT_EEEE_SSSS below about macros defined within macros.
  619.  
  620.      Applications must select macro names from the set of characters
  621.      consisting solely of periods, underscores, digits and alphabetics from
  622.      the portable character set.  A macro name cannot contain an equal sign.
  623.      Implementations may allow other characters in macro names as extensions.
  624.  
  625.      Macros can appear anywhere in the makefile. Macros in target lines will
  626.      be evaluated when the target line is read. Macros in command lines will
  627.      be evaluated when the command is executed. Macros in macro definition
  628.      lines will not be evaluated until the new macro being defined is used in
  629.      a rule or command. A macro that has not been defined will evaluate to a
  630.      null string without causing any error condition.
  631.  
  632.      The forms $$$$((((ssssttttrrrriiiinnnngggg1111[[[[::::ssssuuuubbbbsssstttt1111====[[[[ssssuuuubbbbsssstttt2222]]]]]]]])))) or $$$${{{{ssssttttrrrriiiinnnngggg1111[[[[::::ssssuuuubbbbsssstttt1111====[[[[ssssuuuubbbbsssstttt2222]]]]]]]]}}}}
  633.      can be used to replace all occurrences of _s_u_b_s_t_1 with _s_u_b_s_t_2 when the
  634.      macro substitution is performed. The _s_u_b_s_t_1 to be replaced is recognised
  635.      when it is a suffix at the end of a word in _s_t_r_i_n_g_1 (where a _w_o_r_d, in
  636.      this context, is defined to be a string delimited by the beginning of the
  637.      line, a blank or newline character).
  638.  
  639.      Macro assignments will be accepted from the sources listed below, in the
  640.      order shown. If a macro name already exists at the time it is being
  641.      processed, the newer definition will replace the existing definition.
  642.  
  643.      1.  Macros defined in _m_a_k_e'_s built-in inference rules.
  644.  
  645.      2.  The contents of the environment, including the variables with null
  646.          values, in the order defined in the environment.
  647.  
  648.      3.  Macros defined in the makefiles, processed in the order specified.
  649.  
  650.      4.  Macros specified on the command line. It is unspecified whether the
  651.          internal macros defined in _IIII_nnnn_tttt_eeee_rrrr_nnnn_aaaa_llll _MMMM_aaaa_cccc_rrrr_oooo_ssss are accepted from the
  652.          command line.
  653.  
  654.  
  655.  
  656.  
  657.                                                                        PPPPaaaaggggeeee 11110000
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664. MMMMAAAAKKKKEEEE((((1111))))                                                                MMMMAAAAKKKKEEEE((((1111))))
  665.  
  666.  
  667.  
  668.      If the _----_eeee option is specified, the order of processing sources items 2
  669.      and 3 will be reversed.
  670.  
  671.      The _SSSS_HHHH_EEEE_LLLL_LLLL macro is treated specially. It is provided by _m_a_k_e and set to
  672.      the pathname of the shell command language interpreter (see The _S_H_E_L_L
  673.      environment variable will not affect the value of the _SSSS_HHHH_EEEE_LLLL_LLLL macro. If
  674.      _SSSS_HHHH_EEEE_LLLL_LLLL is defined in the makefile or is specified on the command line, it
  675.      will replace the original value of the _SSSS_HHHH_EEEE_LLLL_LLLL macro, but will not affect
  676.      the _S_H_E_L_L environment variable. Other effects of defining _SSSS_HHHH_EEEE_LLLL_LLLL in the
  677.      makefile or on the command line are implementation-dependent.
  678.  
  679.      IIIInnnnffffeeeerrrreeeennnncccceeee RRRRuuuulllleeeessss
  680.  
  681.      Inference rules are formatted as follows:
  682.  
  683.           _t_a_r_g_e_t:
  684.           <_t_a_b>_c_o_m_m_a_n_d
  685.           [<_t_a_b>_c_o_m_m_a_n_d ]
  686.           ...
  687.           _l_i_n_e _t_h_a_t _d_o_e_s _n_o_t _b_e_g_i_n _w_i_t_h <_t_a_b> _o_r #
  688.  
  689.      The _t_a_r_g_e_t portion must be a valid target name (see "_TTTT_aaaa_rrrr_gggg_eeee_tttt _RRRR_uuuu_llll_eeee_ssss") of
  690.      the form ._s_2 or ._s_1._s_2 (where ._s_1 and ._s_2 are suffixes that have been
  691.      given as prerequisites of the _...._SSSS_UUUU_FFFF_FFFF_IIII_XXXX_EEEE_SSSS special target and _s_1 and _s_2 do
  692.      not contain any slashes or periods.) If there is only one period in the
  693.      target, it is a single-suffix inference rule. Targets with two periods
  694.      are double-suffix inference rules.  Inference rules can have only one
  695.      target before the colon.
  696.  
  697.      The makefile must not specify prerequisites for inference rules; no
  698.      characters other than white space can follow the colon in the first line,
  699.      except when creating the _e_m_p_t_y _r_u_l_e, described below.  Prerequisites are
  700.      inferred, as described below.
  701.  
  702.      Inference rules can be redefined. A target that matches an existing
  703.      inference rule will overwrite the old inference rule. An empty rule can
  704.      be created with a command consisting of simply a semicolon (that is, the
  705.      rule still exists and is found during inference rule search, but since it
  706.      is empty, execution has no effect). The empty rule also can be formatted
  707.      as follows:
  708.  
  709.           _r_u_l_e: ;
  710.  
  711.      where zero or more blank characters separate the colon and semicolon.
  712.  
  713.      The _m_a_k_e utility uses the suffixes of targets and their prerequisites to
  714.      infer how a target can be made up-to-date. A list of inference rules
  715.      defines the commands to be executed. By default, _m_a_k_e contains a built-in
  716.      set of inference rules.  Additional rules can be specified in the
  717.      makefile.
  718.  
  719.  
  720.  
  721.  
  722.  
  723.                                                                        PPPPaaaaggggeeee 11111111
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730. MMMMAAAAKKKKEEEE((((1111))))                                                                MMMMAAAAKKKKEEEE((((1111))))
  731.  
  732.  
  733.  
  734.      The special target ....SSSSUUUUFFFFFFFFIIIIXXXXEEEESSSS contains as its prerequisites a list of
  735.      suffixes that are to be used by the inference rules. The order in which
  736.      the suffixes are specified defines the order in which the inference rules
  737.      for the suffixes are used. New suffixes will be appended to the current
  738.      list by specifying a ....SSSSUUUUFFFFFFFFIIIIXXXXEEEESSSS special target in the makefile. A
  739.      ....SSSSUUUUFFFFFFFFIIIIXXXXEEEESSSS target with no prerequisites will clear the list of suffixes.
  740.      An empty ....SSSSUUUUFFFFFFFFIIIIXXXXEEEESSSS target followed by a new ....SSSSUUUUFFFFFFFFIIIIXXXXEEEESSSS list is required to
  741.      change the order of the suffixes.
  742.  
  743.      Normally, the user would provide an inference rule for each suffix. The
  744.      inference rule to update a target with a suffix ._s_1 from a prerequisite
  745.      with a suffix ._s_2 is specified as a target ._s_2._s_1. The internal macros
  746.      provide the means to specify general inference rules. (See _IIII_nnnn_tttt_eeee_rrrr_nnnn_aaaa_llll
  747.      _MMMM_aaaa_cccc_rrrr_oooo_ssss)
  748.  
  749.      When no target rule is found to update a target, the inference rules are
  750.      checked. The suffix of the target (._s_1) to be built is compared to the
  751.      list of suffixes specified by the ._s_1 suffix is found in _...._SSSS_UUUU_FFFF_FFFF_IIII_XXXX_EEEE_SSSS_,,,, the
  752.      inference rules are searched in the order defined for the first ._s_2._s_1
  753.      rule whose prerequisite file (_$$$$_****.s2) exists. If the target is out-of-date
  754.      with respect to this prerequisite, the commands for that inference rule
  755.      are executed.
  756.  
  757.      If the target to be built does not contain a suffix and there is no rule
  758.      for the target, the single suffix inference rules will be checked. The
  759.      single-suffix inference rules define how to build a target if a file is
  760.      found with a name that matches the target name with one of the single
  761.      suffixes appended. A rule with one suffix ._s_2 is the definition of how to
  762.      build _t_a_r_g_e_t from _t_a_r_g_e_t._s_2. The other suffix (._s_1) is treated as null.
  763.  
  764.      A tilde (_~~~~) in the above rules refers to an SCCS file in the current
  765.      directory. Thus, the rule ....cccc....oooo would transform an SCCS C-language source
  766.      file into an object file ((((....oooo)))).... Because the ssss.... of the SCCS files is a
  767.      prefix, it is incompatible with _m_a_k_e'_s suffix point of view. Hence, the ~~~~
  768.      is a way of changing any file reference into an SCCS file reference.
  769.  
  770.      LLLLiiiibbbbrrrraaaarrrriiiieeeessss
  771.  
  772.      If a target or prerequisite contains parentheses, it will be treated as a
  773.      member of an archive library. For the _l_i_b(_m_e_m_b_e_r._o) expression _l_i_b refers
  774.      to the name of the archive library and _m_e_m_b_e_r._o to the member name. The
  775.      member must be an object file with the ._o suffix. The modification time
  776.      of the expression is the modification time for the member as kept in the
  777.      archive library (_S_e_e _a_r). The ....aaaa suffix refers to an archive library. The
  778.      ._s_2._aaaa rule is used to update a member in the library from a file with a
  779.      suffix ._s_2.
  780.  
  781.      IIIInnnntttteeeerrrrnnnnaaaallll MMMMaaaaccccrrrroooossss
  782.  
  783.      The _m_a_k_e utility maintains five internal macros that can be used in
  784.      target and inference rules. In order to clearly define the meaning of
  785.      these macros, some clarification of the terms _t_a_r_g_e_t _r_u_l_e, _i_n_f_e_r_e_n_c_e
  786.  
  787.  
  788.  
  789.                                                                        PPPPaaaaggggeeee 11112222
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796. MMMMAAAAKKKKEEEE((((1111))))                                                                MMMMAAAAKKKKEEEE((((1111))))
  797.  
  798.  
  799.  
  800.      _r_u_l_e, _t_a_r_g_e_t and _p_r_e_r_e_q_u_i_s_i_t_e is necessary.
  801.  
  802.      Target rules are specified by the user in a makefile for a particular
  803.      target.  Inference rules are user- or _m_a_k_e -specified rules for a
  804.      particular class of target names. Explicit prerequisites are those
  805.      prerequisites specified in a makefile on target lines. Implicit
  806.      prerequisites are those prerequisites that are generated when inference
  807.      rules are used.  Inference rules are applied to implicit prerequisites or
  808.      to explicit prerequisites that do not have target rules defined for them
  809.      in the makefile. Target rules are applied to targets specified in the
  810.      makefile.
  811.  
  812.      Before any target in the makefile is updated, each of its prerequisites
  813.      (both explicit and implicit) will be updated. This is accomplished by
  814.      recursively processing each prerequisite. Upon recursion, each
  815.      prerequisite becomes a target itself. Its prerequisites in turn are
  816.      processed recursively until a target is found that has no prerequisites,
  817.      at which point the recursion stops. The recursion then backs up, updating
  818.      each target as it goes.
  819.  
  820.      In the definitions that follow, the word _t_a_r_g_e_t refers to one of:
  821.  
  822.      -    a target specified in the makefile
  823.  
  824.      -    an explicit prerequisite specified in the makefile that becomes the
  825.           target when _m_a_k_e processes it during recursion
  826.  
  827.      -    an implicit prerequisite that becomes a target when _m_a_k_e processes
  828.           it during recursion.
  829.  
  830.      In the definitions that follow, the word _p_r_e_r_e_q_u_i_s_i_t_e refers to one of
  831.      the following:
  832.  
  833.      -    an explicit prerequisite specified in the makefile for a particular
  834.           target
  835.  
  836.      -    an implicit prerequisite generated as a result of locating an
  837.           appropriate inference rule and corresponding file that matches the
  838.           suffix of the target.
  839.  
  840.      The internal macros are:
  841.  
  842.      $$$$@@@@      The $@ evaluates to the full target name of the current target,
  843.              or the archive filename part of a library archive target. It is
  844.              evaluated for both target and inference rules.  For example, in
  845.              the ....cccc....aaaa inference rule, $@ represents the out-of-date ....aaaa file to
  846.              be built. Similarly, in a makefile target rule to build lllliiiibbbb....aaaa
  847.              from ffffiiiilllleeee....cccc,,,, $@ represents the out-of-date lllliiiibbbb....aaaa....
  848.  
  849.      $$$$$$$$@@@@     The $$@ macro stands for the full target name of the current
  850.              target (which is $$$$@@@@).  It has meaning only on the dependency line
  851.              in a makefile.  Thus, in the following:
  852.  
  853.  
  854.  
  855.                                                                        PPPPaaaaggggeeee 11113333
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862. MMMMAAAAKKKKEEEE((((1111))))                                                                MMMMAAAAKKKKEEEE((((1111))))
  863.  
  864.  
  865.  
  866.                  cat dd: $$@.c
  867.  
  868.              the dependency is translated at execution time first to the
  869.              string ccccaaaatttt....cccc,,,, then to the string dddddddd....cccc....
  870.  
  871.      $$$$%%%%      The $% macro is evaluated only when the current target is an
  872.              archive library member of the form _l_i_b_n_a_m_e(_m_e_m_b_e_r_...._oooo). In these
  873.              cases, $@ evaluates to _l_i_b_n_a_m_e and $% evaluates to _m_e_m_b_e_r._oooo_.... The
  874.              $% macro is evaluated for both target and inference rules.
  875.  
  876.              For example, in a makefile target rule to build lllliiiibbbb....aaaa((((ffffiiiilllleeee....oooo)))),,,, $%
  877.              represents ffffiiiilllleeee....oooo as opposed to $@, which represents lllliiiibbbb....aaaa....
  878.  
  879.      $$$$????      The $? macro evaluates to the list of prerequisites that are
  880.              newer than the current target. It is evaluated for both target
  881.              and inference rules.
  882.  
  883.              For example, in a makefile target rule to build pppprrrroooogggg from
  884.              ffffiiiilllleeee1111....oooo,,,, ffffiiiilllleeee2222....oooo and ffffiiiilllleeee3333....oooo,,,, and where pppprrrroooogggg is not out of date
  885.              with respect to ffffiiiilllleeee1111....oooo,,,, but is out of date with respect to
  886.              ffffiiiilllleeee2222....oooo and ffffiiiilllleeee3333....oooo,,,, $? represents ffffiiiilllleeee2222....oooo and ffffiiiilllleeee3333....oooo....
  887.  
  888.      $$$$<<<<      In an inference rule, $< evaluates to the file name whose
  889.              existence allowed the inference rule to be chosen for the target.
  890.              In the ....DDDDEEEEFFFFAAAAUUUULLLLTTTT rule, the $< macro evaluates to the current
  891.              target name. The $< macro is evaluated only for inference rules.
  892.  
  893.              For example, in the ....cccc....aaaa inference rule, $< represents the
  894.              prerequisite ....cccc file.
  895.  
  896.      $$$$****      The $* macro evaluates to the current target name with its suffix
  897.              deleted. It is evaluated at least for inference rules.
  898.  
  899.              For example, in the ....cccc....aaaa inference rule, $*.o represents the
  900.              out-of-date ....oooo file that corresponds to the prerequisite ....cccc file.
  901.  
  902.      Each of the internal macros has an alternative form. When an upper-case D
  903.      or F is appended to any of the macros, the meaning is changed to the
  904.      _d_i_r_e_c_t_o_r_y _p_a_r_t for D and _f_i_l_e_n_a_m_e part for F. The directory part is the
  905.      path prefix of the file without a trailing slash; for the current
  906.      directory, the directory part is ``.''. When the $? macro contains more
  907.      than one prerequisite filename, the $(?D) and $(?F) (or ${?D} and ${?F})
  908.      macros expand to a list of directory name parts and filename parts
  909.      respectively.
  910.  
  911.      For the target _l_i_b(_m_e_m_b_e_r._o) and the ssss2222....aaaa rule, the internal macros are
  912.      defined as:
  913.  
  914.      $$$$<<<<      _m_e_m_b_e_r._ssss_2222
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.                                                                        PPPPaaaaggggeeee 11114444
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928. MMMMAAAAKKKKEEEE((((1111))))                                                                MMMMAAAAKKKKEEEE((((1111))))
  929.  
  930.  
  931.  
  932.      $$$$****      _m_e_m_b_e_r
  933.  
  934.      $$$$@@@@      _l_i_b
  935.  
  936.      $$$$????      _m_e_m_b_e_r._ssss_2222
  937.  
  938.      $$$$%%%%      _m_e_m_b_e_r._oooo
  939.  
  940.      DDDDeeeeffffaaaauuuulllltttt RRRRuuuulllleeeessss
  941.  
  942.      The default rules for _m_a_k_e achieve results that are the same as if the
  943.      following were used.
  944.  
  945.      SSSSPPPPEEEECCCCIIIIAAAALLLL TTTTAAAARRRRGGGGEEEETTTTSSSS::::
  946.  
  947.       .SCCS_GET: sccs $(SCCSFLAGS) get $(SCCSGETFLAGS) $@
  948.  
  949.       .SUFFIXES: .o .c .y l .a .sh .f .c~ .y~ .l~ .sh~ .f~
  950.  
  951.      MMMMAAAACCCCRRRROOOOSSSS::::
  952.  
  953.      MAKE=make
  954.      AR=ar
  955.      ARFLAGS=-rv
  956.      YACC=yacc
  957.      YFLAGS=
  958.      LEX=lex
  959.      LFLAGS= LDFLAGS=
  960.      CC=c89
  961.      CFLAGS=-O
  962.      FC=fort77
  963.      FFLAGS=-O 1
  964.      GET=get
  965.      GFLAGS= SCCSFLAGS=
  966.      SCCSGETFLAGS=-s
  967.  
  968.      SSSSIIIINNNNGGGGLLLLEEEE SSSSUUUUFFFFFFFFIIIIXXXX RRRRUUUULLLLEEEESSSS
  969.  
  970.       .c:
  971.                $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
  972.  
  973.       .f:
  974.                $(FC) $(FFLAGS) $(LDFLAGS) -o $@ $<
  975.  
  976.       .sh:
  977.                cp $< $@
  978.                chmod a+x $@
  979.       .c~:
  980.                $(GET) $(GFLAGS) -p $< > $*.c
  981.                $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $*.c
  982.  
  983.  
  984.  
  985.  
  986.  
  987.                                                                        PPPPaaaaggggeeee 11115555
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994. MMMMAAAAKKKKEEEE((((1111))))                                                                MMMMAAAAKKKKEEEE((((1111))))
  995.  
  996.  
  997.  
  998.       .f~:
  999.                $(GET) $(GFLAGS) -p $< > $*.f
  1000.                $(FC) $(FFLAGS) $(LDFLAGS) -o $@ $*.f
  1001.  
  1002.       .sh~:
  1003.                $(GET) $(GFLAGS) -p $< > $*.sh
  1004.                cp $*.sh $@
  1005.                chmod a+x $@
  1006.  
  1007.      DDDDOOOOUUUUBBBBLLLLEEEE SSSSUUUUFFFFFFFFIIIIXXXX RRRRUUUULLLLEEEESSSS
  1008.  
  1009.       .c.o:
  1010.                $(CC) $(CFLAGS) -c $<
  1011.  
  1012.       .f.o:
  1013.                $(FC) $(FFLAGS) -c $<
  1014.  
  1015.       .y.o:
  1016.                $(YACC) $(YFLAGS) $<
  1017.                $(CC) $(CFLAGS) -c y.tab.c
  1018.                rm -f y.tab.c
  1019.                mv y.tab.o $@
  1020.  
  1021.       .l.o:
  1022.                $(LEX) $(LFLAGS) $<
  1023.                $(CC) $(CFLAGS) -c lex.yy.c
  1024.                rm -f lex.yy.c
  1025.                mv lex.yy.o $@
  1026.  
  1027.       .y.c:
  1028.                $(YACC) $(YFLAGS) $<
  1029.                mv y.tab.c $@
  1030.  
  1031.       .l.c:
  1032.                $(LEX) $(LFLAGS) $<
  1033.                mv lex.yy.c $@
  1034.  
  1035.       .c~.o:
  1036.                $(GET) $(GFLAGS) -p $< > $*.c
  1037.                $(CC) $(CFLAGS) -c $*.c
  1038.  
  1039.       .f~.o:
  1040.                $(GET) $(GFLAGS) -p $< > $*.f
  1041.                $(FC) $(FFLAGS) -c $*.f
  1042.  
  1043.       .y~.o:
  1044.                $(GET) $(GFLAGS) -p $< > $*.y
  1045.                $(YACC) $(YFLAGS) $*.y
  1046.                $(CC) $(CFLAGS) -c y.tab.c
  1047.                rm -f y.tab.c
  1048.                mv y.tab.o $@
  1049.  
  1050.  
  1051.  
  1052.  
  1053.                                                                        PPPPaaaaggggeeee 11116666
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060. MMMMAAAAKKKKEEEE((((1111))))                                                                MMMMAAAAKKKKEEEE((((1111))))
  1061.  
  1062.  
  1063.  
  1064.       .l~.o:
  1065.                $(GET) $(GFLAGS) -p $< > $*.l
  1066.                $(LEX) $(LFLAGS) $*.l
  1067.                $(CC) $(CFLAGS) -c lex.yy.c
  1068.                rm -f lex.yy.c
  1069.                mv lex.yy.o $@
  1070.  
  1071.       .y~.c:
  1072.                $(GET) $(GFLAGS) -p $< > $*.y
  1073.                $(YACC) $(YFLAGS) $*.y
  1074.                mv y.tab.c $@
  1075.  
  1076.       .l~.c:
  1077.                $(GET) $(GFLAGS) -p $< > $*.l
  1078.                $(LEX) $(LFLAGS) $*.l
  1079.                mv lex.yy.c $@
  1080.  
  1081.       .c.a:
  1082.                $(CC) -c $(CFLAGS) $<
  1083.                $(AR) $(ARFLAGS) $@ $*.o
  1084.                rm -f $*.o
  1085.  
  1086.       .f.a:
  1087.                $(FC) -c $(FFLAGS) $<
  1088.                $(AR) $(ARFLAGS) $@ $*.o
  1089.                rm -f $*.o
  1090.  
  1091. EEEEXXXXIIIITTTT SSSSTTTTAAAATTTTUUUUSSSS
  1092.      When the ----qqqq option is specified, the _m_a_k_e utility will exit with one of
  1093.      the following values:
  1094.  
  1095.       0 Successful completion.
  1096.       1 The target was not up-to-date.
  1097.      >1 An error occurred.
  1098.  
  1099.      When the ----qqqq option is not specified, the _m_a_k_e utility will exit with one
  1100.      of the following values:
  1101.  
  1102.       0 successful completion
  1103.  
  1104.      >0 an error occurred
  1105.  
  1106. AAAAPPPPPPPPLLLLIIIICCCCAAAATTTTIIIIOOOONNNN UUUUSSSSAAAAGGGGEEEE
  1107.      If there is a source file (such as ....////ssssoooouuuurrrrcccceeee....cccc)))) and there are two SCCS
  1108.      files corresponding to it ((((....////ssss....ssssoooouuuurrrrcccceeee....cccc and ....////SSSSCCCCCCCCSSSS////ssss....ssssoooouuuurrrrcccceeee....cccc)))),,,, _m_a_k_e will
  1109.      use the SCCS file in the current directory. However, users are advised to
  1110.      use the underlying SCCS utilities (_a_d_m_i_n, _d_e_l_t_a, _g_e_t, and so forth) or
  1111.      the sccs utility for all source files in a given directory. If both forms
  1112.      are used for a given source file, future developers may be confused.
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.                                                                        PPPPaaaaggggeeee 11117777
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126. MMMMAAAAKKKKEEEE((((1111))))                                                                MMMMAAAAKKKKEEEE((((1111))))
  1127.  
  1128.  
  1129.  
  1130.      It is incumbent upon portable makefiles to specify the ....PPPPOOOOSSSSIIIIXXXX special
  1131.      target in order to guarantee that they are not affected by local
  1132.      extensions.
  1133.  
  1134.      The ----kkkk and ----SSSS options are both present so that the relationship between
  1135.      the command line, the _M_A_K_E_F_L_A_G_S variable, and the makefile can be
  1136.      controlled precisely. If the ----kkkk flag is passed in _M_A_K_E_F_L_A_G_S and a command
  1137.      is of the form:
  1138.  
  1139.           $(MAKE) -S foo
  1140.  
  1141.      then the default behaviour is restored for the child _m_a_k_e.
  1142.  
  1143.      When the ----nnnn option is specified, it is always added to _M_A_K_E_F_L_A_G_S. This
  1144.      allows a recursive _m_a_k_e ----nnnn _t_a_r_g_e_t to be used to see all of the action
  1145.      that would be taken to update _t_a_r_g_e_t.
  1146.  
  1147.      Because of widespread historical practice, interpreting a # number sign
  1148.      inside a variable as the start of a comment has the unfortunate side
  1149.      effect of making it impossible to place a number sign in a variable, thus
  1150.      forbidding something like:
  1151.  
  1152.           CFLAGS = "-D COMMENT_CHAR='#'"
  1153.  
  1154.      Many historical _m_a_k_e utilities stop chaining together inference rules
  1155.      when an intermediate target is non-existent. For example, it might be
  1156.      possible for a _m_a_k_e to determine that both .y.c and .c.o could be used to
  1157.      convert a .y to a .o. Instead, in this case, _m_a_k_e requires the use of a
  1158.      .y.o rule.
  1159.  
  1160.      The best way to provide portable makefiles is to include all of the rules
  1161.      needed in the makefile itself. The rules provided use only features
  1162.      provided by other parts of the standard. The default rules include rules
  1163.      for optional commands in the standard. Only rules pertaining to commands
  1164.      that are provided are needed in an implementation's default set.
  1165.  
  1166.      Macros used within other macros are evaluated when the new macro is used
  1167.      rather than when the new macro is defined. Therefore:
  1168.  
  1169.           MACRO = _v_a_l_u_e_1
  1170.           NEW   = $(MACRO)
  1171.           MACRO = _v_a_l_u_e_2
  1172.  
  1173.           target:
  1174.                  echo $(NEW)
  1175.  
  1176.      would produce _v_a_l_u_e_2 and not _v_a_l_u_e_1 since NNNNEEEEWWWW was not expanded until it
  1177.      was needed in the _e_c_h_o command line.
  1178.  
  1179.      Some historical applications have been known to intermix _t_a_r_g_e_t__n_a_m_e and
  1180.      _m_a_c_r_o=_n_a_m_e operands on the command line, expecting that all of the macros
  1181.      will be processed before any of the targets are dealt with.  Portable
  1182.  
  1183.  
  1184.  
  1185.                                                                        PPPPaaaaggggeeee 11118888
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192. MMMMAAAAKKKKEEEE((((1111))))                                                                MMMMAAAAKKKKEEEE((((1111))))
  1193.  
  1194.  
  1195.  
  1196.      applications do not do this, although some backward compatibility support
  1197.      may be included in some implementations.
  1198.  
  1199.      The following characters in filenames may give trouble:
  1200.  
  1201.           =   :   `   '   @
  1202.  
  1203.      For inference rules, the description of $< and $? seem similar.  However,
  1204.      an example shows the minor difference. In a makefile containing:
  1205.  
  1206.           foo.o: foo.h
  1207.  
  1208.      if ffffoooooooo....hhhh is newer than ffffoooooooo....oooo,,,, yet ffffoooooooo....cccc is older than ffffoooooooo....oooo,,,, the built-in
  1209.      rule to make ffffoooooooo....oooo from ffffoooooooo....cccc will be used, with $< equal to ffffoooooooo....cccc and $?
  1210.      equal to ffffoooooooo....hhhh.... If ffffoooooooo....cccc is also newer than ffffoooooooo....oooo,,,, $< is equal to ffffoooooooo....cccc
  1211.      and $? is equal to ffffoooooooo....hhhh ffffoooooooo....cccc....
  1212.  
  1213. EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
  1214.      1.  The following command:
  1215.  
  1216.               make
  1217.  
  1218.          makes the first target found in the makefile.
  1219.  
  1220.      2.  The following command:
  1221.  
  1222.              make junk
  1223.  
  1224.          makes the target junk.
  1225.  
  1226.      3.  The following makefile says that ppppggggmmmm depends on two files, aaaa....oooo and
  1227.          bbbb....oooo,,,, and that they in turn depend on their corresponding source files
  1228.          ((((aaaa....cccc and bbbb....cccc)))),,,, and a common file iiiinnnnccccllll....hhhh::::
  1229.  
  1230.          pgm: a.o b.o
  1231.                  c89 a.o b.o -o pgm
  1232.  
  1233.          a.o: incl.h a.c
  1234.                  c89 -c a.c
  1235.  
  1236.          b.o: incl.h b.c
  1237.                  c89 -c b.c
  1238.  
  1239.      4.  An example for making optimised ....oooo files from ....cccc files is:
  1240.  
  1241.           .c.o:
  1242.                  c89 -c -O $*.c
  1243.  
  1244.          or:
  1245.  
  1246.           .c.o:
  1247.                  c89 -c -O $<
  1248.  
  1249.  
  1250.  
  1251.                                                                        PPPPaaaaggggeeee 11119999
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258. MMMMAAAAKKKKEEEE((((1111))))                                                                MMMMAAAAKKKKEEEE((((1111))))
  1259.  
  1260.  
  1261.  
  1262.      5.  The most common use of the archive interface follows.  Here, it is
  1263.          assumed that the source files are all C-language source:
  1264.  
  1265.          lib:   lib(file1.o) lib(file2.o) lib(file3.o)
  1266.                 @echo lib is now up-to-date
  1267.  
  1268.          The ....cccc....aaaa rule is used to make ffffiiiilllleeee1111....oooo,,,, ffffiiiilllleeee2222....oooo and ffffiiiilllleeee3333....oooo and insert
  1269.          them into lllliiiibbbb....
  1270.  
  1271.          The treatment of escaped newline characters throughout the makefile
  1272.          is historical practice. For example, the inference rule:
  1273.  
  1274.              .c.o\
  1275.  
  1276.              :
  1277.  
  1278.          works, and the macro:
  1279.  
  1280.              f=     bar baz\
  1281.  
  1282.                     biz
  1283.  
  1284.              a:
  1285.                     echo ==$f==
  1286.  
  1287.          will echo ==bar baz biz==.
  1288.  
  1289.          If $? were:
  1290.  
  1291.              /usr/include/stdio.h /usr/include/unistd.h foo.h
  1292.  
  1293.          then $(?D) would be:
  1294.  
  1295.              /usr/include /usr/include .
  1296.  
  1297.          and $(?F) would be:
  1298.  
  1299.              stdio.h unistd.h foo.h
  1300.  
  1301.  
  1302.      6.  The contents of the built-in rules can be viewed by running:
  1303.  
  1304.              make -p -f /dev/null 2>/dev/null
  1305.  
  1306.  
  1307. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  1308.      _a_r, _c_8_9, _c_c, _g_e_t, _l_e_x, _s_h,
  1309.  
  1310. NNNNOOOOTTTTEEEESSSS
  1311.      The VPATH facility is a derivation of the undocumented VPATH feature in
  1312.      the System V Release 3 version of _m_a_k_e.  System V Release 4 has a new
  1313.      VPATH implementation, much like the _p_m_a_k_e(1) ....PPPPAAAATTTTHHHH feature. This new
  1314.  
  1315.  
  1316.  
  1317.                                                                        PPPPaaaaggggeeee 22220000
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324. MMMMAAAAKKKKEEEE((((1111))))                                                                MMMMAAAAKKKKEEEE((((1111))))
  1325.  
  1326.  
  1327.  
  1328.      feature is also undocumented in the standard System V Release 4 manual
  1329.      pages.  For this reason it is not available in the IRIX version of _m_a_k_e .
  1330.      The VPATH facility should not be used with the new parallel make option.
  1331.  
  1332.      An added feature is the ability for macros to be placed with macros.  For
  1333.      example, when FLAGS = TYPE, then $(MAKE_${FLAGS}) will get expanded to
  1334.      the macro $(MAKE_TYPE). This syntax can handle about 100 levels of
  1335.      imbedding.
  1336.  
  1337. CCCCOOOOMMMMPPPPAAAATTTTIIIIBBBBIIIILLLLIIIITTTTYYYY IIIISSSSSSSSUUUUEEEESSSS
  1338.      When the special target _...._PPPP_OOOO_SSSS_IIII_XXXX is not specified, the following backward
  1339.      compatible actions take place:
  1340.  
  1341.      1.  The content of the _MMMM_AAAA_KKKK_EEEE_FFFF_LLLL_AAAA_GGGG_SSSS variable will contain only the command
  1342.          line options and not command line macros.
  1343.  
  1344. BBBBUUUUGGGGSSSS
  1345.      Filenames with the characters ==== :::: @@@@ will not work.
  1346.  
  1347.      Commands that are directly executed by the shell, notably _c_d(1), are
  1348.      ineffectual across new-lines in _m_a_k_e.
  1349.  
  1350.      The syntax ((((lllliiiibbbb((((ffffiiiilllleeee1111....oooo ffffiiiilllleeee2222....oooo ffffiiiilllleeee3333....oooo)))) is illegal.
  1351.  
  1352.      You cannot build lllliiiibbbb((((ffffiiiilllleeee....oooo)))) from ffffiiiilllleeee....oooo.
  1353.  
  1354.      The macro $$$$((((aaaa::::....oooo====....cccc~~~~)))) does not work.
  1355.  
  1356.      Named pipes are not handled well.
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.                                                                        PPPPaaaaggggeeee 22221111
  1384.  
  1385.  
  1386.  
  1387.